// $Id$
package cz.pd.projectbuilder.beans.load;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author diblik
 * @version $Revision$
 */
@XStreamAlias("group")
public class ProjectGroupBean implements Serializable {

  private static final long serialVersionUID = -5136545839451292391L;
  @XStreamAlias("name")
  @XStreamAsAttribute
  private String groupName;
  @XStreamAlias("pathPreffix")
  @XStreamAsAttribute
  private String groupPathPreffix;
  @XStreamImplicit
  @XStreamAlias("projekty")
  private List<ProjectBean> projectBeans;
  @XStreamAsAttribute
  private Boolean subprojekty;

  public ProjectGroupBean(String groupName, ArrayList<ProjectBean> projectBeans) {
    this.groupName = groupName;
    this.projectBeans = projectBeans;
  }

  public ProjectGroupBean(String groupName, String groupPathPreffix,
          ArrayList<ProjectBean> projectBeans) {
    this.groupName = groupName;
    this.groupPathPreffix = groupPathPreffix;
    this.projectBeans = projectBeans;
  }

  public List<ProjectBean> getProjectBeans() {
    return projectBeans;
  }

  public void setProjectBeans(List<ProjectBean> projectBeans) {
    this.projectBeans = projectBeans;
  }

  public String getGroupName() {
    return groupName;
  }

  public void setGroupName(String groupName) {
    this.groupName = groupName;
  }

  public String getGroupPathPreffix() {
    return groupPathPreffix;
  }

  public void setGroupPathPreffix(String groupPathPreffix) {
    this.groupPathPreffix = groupPathPreffix;
  }

  public Boolean getSubprojekty() {
    return subprojekty;
  }

  public void setSubprojekty(Boolean subprojekty) {
    this.subprojekty = subprojekty;
  }

  @Override
  public String toString() {
    return "\nname: " + groupName.toString() + "\npath preffix: " + groupPathPreffix.toString() + "\n " + projectBeans.toString();
  }
}
